using System;
using System.Collections.Generic;

namespace BLGenerator.BusinessLogic
{
    public class FieldCollection : List<Field>
    {
        public Field FindByColumnName(string columnName)
        {
            foreach (Field field in this)
                if (field.ColumnName == columnName) return field;
            throw new ArgumentException(string.Format("Field with ColumnName [{0}] not found", columnName));
        }
    }
}